package com.flyduck.mall.pms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.flyduck.mall.pms.admin.vo.AdminProductQueryReqVO;
import com.flyduck.mall.pms.admin.vo.AdminProductRespVO;
import com.flyduck.mall.pms.domain.PmsProduct;
import org.apache.ibatis.annotations.Param;

/**
 * 商品Mapper接口
 *
 * @author flyduck
 * @date 2025-01-18
 */
public interface PmsProductMapper extends BaseMapper<PmsProduct> {
    int reduceStock(@Param("productId") Long productId, @Param("quantity") Integer quantity);

    int releaseStock(@Param("productId") Long productId, @Param("quantity") Integer quantity);

    Page<AdminProductRespVO> getProductPage(@Param("page") Page page, @Param("adminProductQueryReqVO") AdminProductQueryReqVO adminProductQueryReqVO);
}
